import javax.swing.table.AbstractTableModel;

public class SearchTableModel extends AbstractTableModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String columnNames[] = { "Nazwa pliku", "Rozmiar", "Wlasciciel", "IP", "Port nasluchu" };

	private Object data[][];// = {{ "Nazwa pliku", "Rozmiar", "Wlasciciel" }};

	public SearchTableModel() {
		 data = new String[1000][5];
		 data[0][0] = "Obecnie";
		 data[0][1] = "brak";
		 data[0][2] = "plikow";
		 data[0][3] = "udostepnianych";
		 data[0][4] = "w sieci";
	}

	public Object[][] getData() {
		return data;
	}

	public void setData(Object data[][]) {
		this.data = data;
	}

	@Override
	public int getColumnCount() {
		return columnNames.length;
	}

	@Override
	public int getRowCount() {
		return data.length;
	}

	public String getColumnName(int col) {
		return columnNames[col];
	}

	@Override
	public Object getValueAt(int row, int col) {
		return data[row][col];
	}

	public Class<? extends Object> getColumnClass(int c) {
		return getValueAt(0, c).getClass();
	}

}
